package com.leo.entity;

import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.entity.Entity;
import com.almasb.fxgl.entity.EntityFactory;
import com.almasb.fxgl.entity.SpawnData;
import com.almasb.fxgl.entity.Spawns;
import com.leo.component.CombinationComponent;

/**
 * @Author: wangss
 * @CreateTime: 2023-06-06  19:11
 * @Description: 组合实体
 */
public class CombinationEntityFactory implements EntityFactory {

    @Spawns("child")
    public Entity createChild(SpawnData spawnData) {
        return FXGL.entityBuilder(spawnData)
                .with(new CombinationComponent())
                .build();
    }
}
